<?php
/**
 * Gets Unpaid Reservations
 */

$billing = new RM_Billing();
$reservations = $billing->getAll("unpaid")->toArray();

$total = count($reservations);

?>

<style type="text/css">
<!--
body{
	font-family:Arial,Helvetica,sans-serif;
}
.tableheading{
	font-weight: bold;
}
.rm_report_text_body {
	margin-left: 20px;
	margin-right: 20px;
	font-size: 12px;
}
.row0 {
    background-color: #ffffff;
}

.row1 {
    background-color: #f0f0f0;
}

-->
</style>

<div class="rm_report_text_body">
    <b>All Reservations with Payments Due</b><br/>
    <hr>
    Total Reservations: <b><?php echo $total;?></b><br/><br/>
    <table width="100%" border="0" cellpadding="2" cellspacing="0">
        <tr>
            <th><b>Reservation ID</b></th>
            <th><b>Transaction ID</b></th>
            <th><b>Transaction Date</b></th>
            <th><b>Provider</b></th>
            <th><b>Status</b></th>
            <th><b>Total Paid</b></th>
            <th><b>Total Due</b></th>
        </tr>
    <?php
    $rowclass = 0;
    foreach($reservations as $reservation){
        ?>
        <tr class="row<?php echo $rowclass; ?>">
            <td><?php echo $reservation['reservation_id'];?></td>
            <td><?php echo $reservation['transaction_id'];?></td>
            <td><?php echo $reservation['transaction_date'];?></td>
            <td><?php echo $reservation['provider'];?></td>
            <td><?php echo $reservation['status'];?></td>
            <td><?php echo $reservation['total_paid'];?></td>
            <td><?php echo $reservation['total'];?></td>
        </tr>
        <?php
        $rowclass = 1 - $rowclass;
    }
    ?>
    </table>
</div>